home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / pageitem_textframe.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-02-04  |  3.3 KB  |  112 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.                           pageitem.h  -  description
  9.                              -------------------
  10.     copyright            : Scribus Team
  11.  ***************************************************************************/
  12.  
  13. /***************************************************************************
  14.  *                                                                         *
  15.  *   This program is free software; you can redistribute it and/or modify  *
  16.  *   it under the terms of the GNU General Public License as published by  *
  17.  *   the Free Software Foundation; either version 2 of the License, or     *
  18.  *   (at your option) any later version.                                   *
  19.  *                                                                         *
  20.  ***************************************************************************/
  21.  
  22. #ifndef PAGEITEMTEXTFRAME_H
  23. #define PAGEITEMTEXTFRAME_H
  24.  
  25. #include <QMap>
  26. #include <QRectF>
  27. #include <QString>
  28. #include <QKeyEvent>
  29.  
  30. #include "scribusapi.h"
  31. #include "pageitem.h"
  32.  
  33. class ScPainter;
  34. class ScribusDoc;
  35.  
  36. #include "text/nlsconfig.h"
  37.  
  38. #ifdef NLS_PROTO
  39. #include "text/sctextengine.h"
  40. #include "text/scfont.h"
  41. #include "sctextstruct.h"
  42. class ScText;
  43. class ScStyleRun;
  44. #endif
  45.  
  46. class SCRIBUS_API PageItem_TextFrame : public PageItem
  47. {
  48.     Q_OBJECT
  49.  
  50. public:
  51.     PageItem_TextFrame(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
  52.     PageItem_TextFrame(const PageItem & p);
  53.     ~PageItem_TextFrame() {};
  54.  
  55.     virtual PageItem_TextFrame * asTextFrame() { return this; }
  56.     
  57.     virtual void clearContents();
  58.     
  59.     /**
  60.     * \brief Handle keyboard interaction with the text frame while in edit mode
  61.     * @param k key event
  62.     * @param keyRepeat a reference to the keyRepeat property
  63.     */
  64.     virtual void handleModeEditKey(QKeyEvent *k, bool& keyRepeat);
  65.     void deleteSelectedTextFromFrame();
  66.     void setNewPos(int oldPos, int len, int dir);
  67.     void ExpandSel(int dir, int oldPos);
  68.     void deselectAll();
  69.     
  70.     virtual void invalidateLayout();
  71.     virtual void layout();
  72.  
  73.     double columnWidth();
  74. #ifdef NLS_PROTO
  75.     int firstTextItem() const { return itemText.firstFrameItem; }
  76.     int lastTextItem() const { return itemText.lastFrameItem; }
  77. #endif
  78.     
  79. protected:
  80.     virtual void DrawObj_Item(ScPainter *p, QRectF e, double sc);
  81.     virtual void DrawObj_Post(ScPainter *p);
  82.     void drawOverflowMarker(ScPainter *p);
  83.     void drawColumnBorders(ScPainter *p);
  84.     QRegion availableRegion(QRegion clip);
  85.  
  86. #ifdef NLS_PROTO
  87.     void DrawLineItem(ScPainter *p, double width,
  88.                       ScScriptItem *item, uint itemIndex);
  89. #endif
  90.     
  91.     bool unicodeTextEditMode;
  92.     int unicodeInputCount;
  93.     QString unicodeInputString;
  94.     
  95.     virtual bool createInfoGroup(QFrame *, QGridLayout *);
  96. //    virtual bool createContextMenu(QMenu *, int);
  97.     virtual void applicableActions(QStringList& actionList);
  98.     virtual QString infoDescription();
  99.     
  100. private:
  101.     bool cursorBiasBackward;
  102.  
  103.     void setShadow();
  104.     QString currentShadow;
  105.     QMap<QString,StoryText> shadows;
  106.     
  107. private slots:
  108.     void slotInvalidateLayout();
  109. };
  110.  
  111. #endif
  112.